home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / bin / user-params < prev    next >
Text File  |  2009-02-27  |  2KB  |  99 lines

  1. #!/bin/sh
  2. if [ -z "$TESTSUITE" ]; then
  3.     CMDLINE=/proc/cmdline
  4.     ALIASES=/etc/preseed_aliases
  5. else
  6.     CMDLINE=user-params.in
  7.     ALIASES=user-params.aliases
  8. fi
  9.  
  10. # sed out multi-word quoted value settings
  11. for item in $(sed -e 's/[^ =]*="[^"]*[ ][^"]*"//g' \
  12.           -e "s/[^ =]*='[^']*[ ][^']*'//g" $CMDLINE); do
  13.     var="${item%=*}"
  14.     # Remove trailing '?' for debconf variables set with '?='
  15.     var="${var%\?}"
  16.  
  17.     if [ "$item" = "--" ]; then
  18.         inuser=1
  19.         collect=""
  20.     elif [ "$inuser" ]; then
  21.         # BOOT_IMAGE is added by syslinux
  22.         if [ "$var" = "BOOT_IMAGE" ]; then
  23.             continue
  24.         fi
  25.  
  26.         # init is not generally useful to pass on
  27.         if [ "$var" = init ]; then
  28.             continue
  29.         fi
  30.  
  31.         # suppress installer-specific parameters
  32.         if [ "$var" = BOOT_DEBUG ] || [ "$var" = DEBIAN_FRONTEND ] || \
  33.            [ "$var" = INSTALL_MEDIA_DEV ] || [ "$var" = lowmem ] || \
  34.            [ "$var" = noshell ]; then
  35.             continue
  36.         fi
  37.  
  38.         # brltty settings shouldn't be passed since
  39.         # they are already recorded in /etc/brltty.conf
  40.         if [ "$var" = brltty ]; then
  41.             continue
  42.         fi
  43.  
  44.         # ks is only useful to kickseed in the first stage.
  45.         if [ "$var" = ks ]; then
  46.             continue
  47.         fi
  48.  
  49.         # We don't believe that vga= is needed to display a console
  50.         # any more now that we've switched to 640x400 by default,
  51.         # and it breaks suspend/resume. People can always type it in
  52.         # again at the installed boot loader if need be.
  53.         if [ "$var" = vga ]; then
  54.             continue
  55.         fi
  56.  
  57.         # Sometimes used on the live CD for debugging initramfs-tools.
  58.         if [ "$var" = break ]; then
  59.             continue
  60.         fi
  61.  
  62.         # Skip debconf variables
  63.         varnoslash="${var##*/*}"
  64.         if [ "$varnoslash" = "" ]; then
  65.             continue
  66.         fi
  67.  
  68.         # Skip module-specific variables
  69.         varnodot="${var##*.*}"
  70.         if [ "$varnodot" = "" ]; then
  71.             continue
  72.         fi
  73.  
  74.         # Skip preseed aliases
  75.         if [ -e "$ALIASES" ] && \
  76.            grep -q "^$var[[:space:]]" "$ALIASES"; then
  77.             continue
  78.         fi
  79.  
  80.         if [ -z "$collect" ]; then
  81.             collect="$item"
  82.         else
  83.             collect="$collect $item"
  84.         fi
  85.     fi
  86. done
  87.  
  88. if [ -z "$TESTSUITE" ]; then
  89.     # Include default parameters
  90.     RET=`debconf-get debian-installer/add-kernel-opts || true`
  91.     if [ "$RET" ]; then
  92.             collect="$collect $RET"
  93.     fi
  94. fi
  95.  
  96. for word in $collect; do
  97.     echo "$word"
  98. done
  99.